package com.study.talk.data.remote

import com.study.talk.data.model.User
import com.study.talk.data.model.UserInfo
import com.study.talk.data.model.resp.ResultResponse
import com.study.talk.data.model.vo.PasswordVo
import com.study.talk.data.model.vo.RegisterUserVo
import com.study.talk.data.model.vo.UserInfoVo
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path

interface UserApi {

    @GET("/userInfo/get/{userId}")
    suspend fun getUserInfo(@Path("userId") userId: Int): Response<ResultResponse<UserInfo>>

    @PUT("/userInfo/update")
    suspend fun updateUserInfo(@Body userInfo: UserInfo): Response<ResultResponse<UserInfo>>

    @GET("/userInfo/get/list/{keyword}")
    suspend fun searchUsers(@Path("keyword") keyword: String): Response<ResultResponse<List<UserInfo>>>

    @POST("/user/register")
    suspend fun register(@Body userInfoVo: UserInfoVo): Response<ResultResponse<String>>

    @POST("/user/register/simple")
    suspend fun registerSimple(@Body registerUserVo: RegisterUserVo): Response<ResultResponse<User>>

    @PUT("/user/update/password")
    suspend fun updatePwd(@Body passwordVo: PasswordVo) : Response<ResultResponse<Boolean>>
}